
/*class Myarray{
    public Object[] arrays= new Object[10];

    public void set(Object object,int pos){
        arrays[pos]=object;
    }
    public Object get(int pos){
        return arrays[pos];
    }
}*/
class Myarray<E>{
    public Object[] arrays= new Object[10];

    public void set(E object,int pos){
        arrays[pos]=object;
    }
    public E get(int pos){
        return (E) arrays[pos];
    }
}
public class Text {
    public static void main(String[] args) {
        Myarray<Integer> myarray=new Myarray<>();
        myarray.set(1,0);
        int a=myarray.get(0);
        System.out.println(a);
        Myarray<String> myarray1=new Myarray<>();
        myarray1.set("hhhh",0);
        String str=myarray1.get(0);
        System.out.println(str);
    }
    public static void main1(String[] args) {
        Myarray myarray=new Myarray();
        myarray.set(10,0);
        myarray.set("haha",1);
        String str=(String) myarray.get(1);
        System.out.println(myarray.get(0));
        System.out.println(myarray.get(1));
    }
}
